import request from '../utils/request'
// 关注用户
export const followUser = (data) => {
  return request({
    url: '/v1_0/user/followings',
    method: 'post',
    data
  })
}

// 取消关注用户
export const notFollowUser = (target) => {
  return request({
    url: `/v1_0/user/followings/${target}`,
    method: 'delete'
  })
}

// 获取联想建议
export const searchSuggest = (params) => {
  return request({
    url: '/v1_0/suggestion',
    params
  })
}

// 获取搜索结果
export const searchResult = (params) => {
  return request({
    url: '/v1_0/search',
    params
  })
}

// 编辑用户资料
export const editUserInfo = (data) => {
  return request({
    url: '/v1_0/user/profile',
    method: 'patch',
    data
  })
}

// 编辑用户头像
export const editUserAvater = (data) => {
  return request({
    url: '/v1_0/user/photo',
    method: 'patch',
    data
  })
}

// 获取用户搜索历史
export const getSearchHistory = (params) => {
  return request({
    url: '/v1_0/user/histories',
    params
  })
}

// 获取用户收藏
export const getCollectList = (params) => {
  return request({
    url: '/v1_0/article/collections',
    params
  })
}
